package io.imp.modules.tasks.unionqrc.service;

import io.imp.commons.dynamic.datasource.annotation.DataSource;
import io.imp.modules.tasks.unionqrc.dao.ItcsUnionpayCancelJnlDao;
import io.imp.modules.tasks.unionqrc.entity.ItcsUnionpayCancelJnl;
import io.imp.orm.Condition;
import io.imp.orm.Order;
import io.imp.orm.Pager;
import io.imp.orm.PagerRecords;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;


/**
 * generated by Generate POJOs.groovy 
 * <p>Date: Fri Mar 01 14:32:12 CST 2019.</p>
 *
 * @author wanghui
 */

@Service
@Transactional(rollbackFor = Exception.class)
public class ItcsUnionpayCancelJnlService {

	@Autowired
	private ItcsUnionpayCancelJnlDao itcsUnionpayCancelJnlDao;

	/**
	 * 分页查询信息
	 */
	@DataSource("slave1")
	public PagerRecords getItcsUnionpayCancelJnlPager(Pager pager, Collection<Condition> conditions, Collection<Order> orders) {
		return itcsUnionpayCancelJnlDao.findByPager(pager, conditions, orders);
	}

	/**
	 * 根据主键查询
	 */
	@DataSource("slave1")
	public ItcsUnionpayCancelJnl getItcsUnionpayCancelJnl(String id) {
		return itcsUnionpayCancelJnlDao.findOne(id);
	}

	/**
	 * 唯一值查询
	 */
	@DataSource("slave1")
	public ItcsUnionpayCancelJnl getItcsUnionpayCancelJnlWithOne(String[] properties, Object[] values) {
		return  itcsUnionpayCancelJnlDao.findFirstByProperties(properties, values);
	}

	/**
	 * 查询列表
	 */
	@DataSource("slave1")
	public List<ItcsUnionpayCancelJnl> getItcsUnionpayCancelJnlWithList(String[] properties, Object[] values) {
		return itcsUnionpayCancelJnlDao.findList(properties, values);
	}

	/**
	 * 根据origqryid获得指定属性集合
	 */
	@DataSource("slave1")
	public ItcsUnionpayCancelJnl getByOrigqryid(String origqryid){
		return itcsUnionpayCancelJnlDao.getByOrigqryid(origqryid);
	}

	@DataSource("slave1")
	public List<ItcsUnionpayCancelJnl> getItcsUnionpayCancelJnlsByTime(String nowTime,String lTime){
		return itcsUnionpayCancelJnlDao.getItcsUnionpayCancelJnlsByTime(nowTime,lTime);
	}

	@DataSource("slave1")
	public void update(String fileFlag,String txnNo){
		itcsUnionpayCancelJnlDao.update(fileFlag,txnNo);
	}

	@DataSource("slave1")
	public List<ItcsUnionpayCancelJnl> LeakFillingCancel(String nowTime){
		return itcsUnionpayCancelJnlDao.LeakFillingCancel(nowTime);
	}
}
